package com.test.demo.consumer;

import com.test.demo.consumer.listener.DemoServiceListenerImpl;
import com.test.demo.provider.service.DemoService;
import org.apache.dubbo.config.annotation.Reference;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class CallbackCosumer {

    @Reference(version = "callback")
    private DemoService demoService;
    @Test
    void contextLoads() {
        System.out.println(demoService.sayHello("world1",new DemoServiceListenerImpl()));
        System.out.println(demoService.sayHello("world2",new DemoServiceListenerImpl()));
//        System.out.println(demoService.sayHello("world3",new DemoServiceListenerImpl()));
//        System.out.println(demoService.sayHello("world4",new DemoServiceListenerImpl()));

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
